import { useState, useEffect } from "react";
import { Modal, Alert, Form, Radio, Button, Card, Switch, Row, Col, Space, message } from "antd";
import { CommonModal } from "@/views/components/CommonModal";
import { CloseCircleOutlined } from "@ant-design/icons";
import { useLocation, useNavigate } from "react-router-dom";

const SelectBatchDeleteGoodsModal = props => {
	const { isSkuType, setTabValue, deleteIds, fetchList, selectedKeys, onCancel } = props;
	const navigate = useNavigate();

	const handleOk = () => {
		console.log("查看可删除商品", deleteIds, isSkuType);
		onCancel();
		// setTabValue(isSkuType ? "sku": "spu");
		// navigate(`/views/goods/system?ids=${deleteIds.join(",")}`);
		setTabValue("sku");
		fetchList({ ids: deleteIds.join(",") || "-1" });
	};
	return (
		<CommonModal
			title={{ title: "注意" }}
			open={true}
			width="528px"
			okText="保存"
			onCancel={props.onCancel}
			footer={
				<Row justify="space-between" style={{ alignItems: "center" }}>
					<Col></Col>
					<Col>
						<Space>
							<Button size="middle" onClick={props.onCancel}>
								取消
							</Button>
							<Button size="middle" type="primary" onClick={handleOk}>
								查看可删除商品
							</Button>
						</Space>
					</Col>
				</Row>
			}
		>
			<div style={{ marginBottom: "15px", justifyContent: "center", color: "rgba(240, 61, 41, 1)" }} className="flex">
				<CloseCircleOutlined style={{ fontSize: 20, marginRight: 5 }} />
				当前存在待处理订单！无法删除
			</div>
		</CommonModal>
	);
};
export default SelectBatchDeleteGoodsModal;
